﻿using SD.Infrastructure.EntityBase;

namespace SD.ContentSystem.Domain.Entities
{
    /// <summary>
    /// 链接
    /// </summary>
    public class Link : AggregateRootEntity
    {
        #region # 构造器

        #region 00.无参构造器
        /// <summary>
        /// 无参构造器
        /// </summary>
        protected Link() { }
        #endregion

        #region 01.创建链接构造器
        /// <summary>
        /// 创建链接构造器
        /// </summary>
        /// <param name="linkCategoryNo">链接类别编号</param>
        /// <param name="linkName">链接名称</param>
        /// <param name="url">链接地址</param>
        /// <param name="imagePath">图片路径</param>
        /// <param name="description">描述</param>
        public Link(string linkCategoryNo, string linkName, string url, string imagePath, string description)
            : this()
        {
            this.LinkCategoryNo = linkCategoryNo;
            base.Name = linkName;
            this.Url = url;
            this.ImagePath = imagePath;
            this.Description = description;
        }
        #endregion

        #endregion

        #region # 属性

        #region 链接类别编号 —— string LinkCategoryNo
        /// <summary>
        /// 链接类别编号
        /// </summary>
        public string LinkCategoryNo { get; private set; }
        #endregion

        #region 链接地址 —— string Url
        /// <summary>
        /// 链接地址
        /// </summary>
        public string Url { get; private set; }
        #endregion

        #region 图片路径 —— string ImagePath
        /// <summary>
        /// 图片路径
        /// </summary>
        public string ImagePath { get; private set; }
        #endregion

        #region 描述 —— string Description
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; private set; }
        #endregion

        #endregion

        #region # 方法

        #region 修改链接信息 —— void UpdateInfo(string linkName, string url...
        /// <summary>
        /// 修改链接信息
        /// </summary>
        /// <param name="linkName">链接名称</param>
        /// <param name="url">链接地址</param>
        /// <param name="imagePath">图片路径</param>
        /// <param name="description">描述</param>
        public void UpdateInfo(string linkName, string url, string imagePath, string description)
        {
            this.Name = linkName;
            this.Url = url;
            this.ImagePath = imagePath;
            this.Description = description;
        }
        #endregion

        #endregion
    }
}
